home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / QDOffscreen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  7.0 KB  |  251 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        QDOffscreen.h
  3.  
  4.      Contains:    Quickdraw Offscreen GWorld Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QDOFFSCREEN__
  19. #define __QDOFFSCREEN__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.     pixPurgeBit                    = 0,
  53.     noNewDeviceBit                = 1,
  54.     useTempMemBit                = 2,
  55.     keepLocalBit                = 3,
  56.     pixelsPurgeableBit            = 6,
  57.     pixelsLockedBit                = 7,
  58.     mapPixBit                    = 16,
  59.     newDepthBit                    = 17,
  60.     alignPixBit                    = 18,
  61.     newRowBytesBit                = 19,
  62.     reallocPixBit                = 20,
  63.     clipPixBit                    = 28,
  64.     stretchPixBit                = 29,
  65.     ditherPixBit                = 30,
  66.     gwFlagErrBit                = 31
  67. };
  68.  
  69.  
  70. enum {
  71.     pixPurge                    = 1L << pixPurgeBit,
  72.     noNewDevice                    = 1L << noNewDeviceBit,
  73.     useTempMem                    = 1L << useTempMemBit,
  74.     keepLocal                    = 1L << keepLocalBit,
  75.     pixelsPurgeable                = 1L << pixelsPurgeableBit,
  76.     pixelsLocked                = 1L << pixelsLockedBit,
  77.     kAllocDirectDrawSurface        = 1L << 14,
  78.     mapPix                        = 1L << mapPixBit,
  79.     newDepth                    = 1L << newDepthBit,
  80.     alignPix                    = 1L << alignPixBit,
  81.     newRowBytes                    = 1L << newRowBytesBit,
  82.     reallocPix                    = 1L << reallocPixBit,
  83.     clipPix                        = 1L << clipPixBit,
  84.     stretchPix                    = 1L << stretchPixBit,
  85.     ditherPix                    = 1L << ditherPixBit,
  86.     gwFlagErr                    = 1L << gwFlagErrBit
  87. };
  88.  
  89. typedef unsigned long                     GWorldFlags;
  90. /* Type definition of a GWorldPtr */
  91. typedef CGrafPtr                         GWorldPtr;
  92. EXTERN_API( QDErr )
  93. NewGWorld                        (GWorldPtr *            offscreenGWorld,
  94.                                  short                     PixelDepth,
  95.                                  const Rect *            boundsRect,
  96.                                  CTabHandle             cTable,
  97.                                  GDHandle                 aGDevice,
  98.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0000, 0xAB1D);
  99.  
  100. #if !TARGET_OS_MAC
  101. /* Quicktime 3.0 */
  102. #if TARGET_OS_WIN32
  103. /* gdevice attribute bits*/
  104.  
  105. enum {
  106.     deviceIsIndirect            = (1L << 0),
  107.     deviceNeedsLock                = (1L << 1),
  108.     deviceIsStatic                = (1L << 2),
  109.     deviceIsExternalBuffer        = (1L << 3),
  110.     deviceIsDDSurface            = (1L << 4),
  111.     deviceIsDCISurface            = (1L << 5),
  112.     deviceIsGDISurface            = (1L << 6),
  113.     deviceIsAScreen                = (1L << 7),
  114.     deviceIsOverlaySurface        = (1L << 8)
  115. };
  116.  
  117. EXTERN_API( void *)
  118. GetGDeviceSurface                (GDHandle                 gdh);
  119.  
  120. EXTERN_API( unsigned long )
  121. GetGDeviceAttributes            (GDHandle                 gdh);
  122.  
  123. /* to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) */
  124. EXTERN_API( QDErr )
  125. NewGWorldFromHBITMAP            (GWorldPtr *            offscreenGWorld,
  126.                                  CTabHandle             cTable,
  127.                                  GDHandle                 aGDevice,
  128.                                  GWorldFlags             flags,
  129.                                  void *                    newHBITMAP,
  130.                                  void *                    newHDC);
  131.  
  132. #endif  /* TARGET_OS_WIN32 */
  133.  
  134. EXTERN_API( QDErr )
  135. NewGWorldFromPtr                (GWorldPtr *            offscreenGWorld,
  136.                                  unsigned long             PixelFormat,
  137.                                  const Rect *            boundsRect,
  138.                                  CTabHandle             cTable,
  139.                                  GDHandle                 aGDevice,
  140.                                  GWorldFlags             flags,
  141.                                  Ptr                     newBuffer,
  142.                                  long                     rowBytes);
  143.  
  144. #endif  /*  !TARGET_OS_MAC */
  145.  
  146. EXTERN_API( Boolean )
  147. LockPixels                        (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xAB1D);
  148.  
  149. EXTERN_API( void )
  150. UnlockPixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0002, 0xAB1D);
  151.  
  152. EXTERN_API( GWorldFlags )
  153. UpdateGWorld                    (GWorldPtr *            offscreenGWorld,
  154.                                  short                     pixelDepth,
  155.                                  const Rect *            boundsRect,
  156.                                  CTabHandle             cTable,
  157.                                  GDHandle                 aGDevice,
  158.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0003, 0xAB1D);
  159.  
  160. EXTERN_API( void )
  161. DisposeGWorld                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xAB1D);
  162.  
  163. EXTERN_API( void )
  164. GetGWorld                        (CGrafPtr *                port,
  165.                                  GDHandle *                gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0005, 0xAB1D);
  166.  
  167. EXTERN_API( void )
  168. SetGWorld                        (CGrafPtr                 port,
  169.                                  GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0006, 0xAB1D);
  170.  
  171. EXTERN_API( void )
  172. CTabChanged                        (CTabHandle             ctab)                                FOURWORDINLINE(0x203C, 0x0004, 0x0007, 0xAB1D);
  173.  
  174. EXTERN_API( void )
  175. PixPatChanged                    (PixPatHandle             ppat)                                FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xAB1D);
  176.  
  177. EXTERN_API( void )
  178. PortChanged                        (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0009, 0xAB1D);
  179.  
  180. EXTERN_API( void )
  181. GDeviceChanged                    (GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0004, 0x000A, 0xAB1D);
  182.  
  183. EXTERN_API( void )
  184. AllowPurgePixels                (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xAB1D);
  185.  
  186. EXTERN_API( void )
  187. NoPurgePixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000C, 0xAB1D);
  188.  
  189. EXTERN_API( GWorldFlags )
  190. GetPixelsState                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000D, 0xAB1D);
  191.  
  192. EXTERN_API( void )
  193. SetPixelsState                    (PixMapHandle             pm,
  194.                                  GWorldFlags             state)                                FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xAB1D);
  195.  
  196. EXTERN_API( Ptr )
  197. GetPixBaseAddr                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xAB1D);
  198.  
  199. EXTERN_API( QDErr )
  200. NewScreenBuffer                    (const Rect *            globalRect,
  201.                                  Boolean                 purgeable,
  202.                                  GDHandle *                gdh,
  203.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0010, 0xAB1D);
  204.  
  205. EXTERN_API( void )
  206. DisposeScreenBuffer                (PixMapHandle             offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x0004, 0x0011, 0xAB1D);
  207.  
  208. EXTERN_API( GDHandle )
  209. GetGWorldDevice                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0012, 0xAB1D);
  210.  
  211. EXTERN_API( Boolean )
  212. QDDone                            (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0013, 0xAB1D);
  213.  
  214. EXTERN_API( long )
  215. OffscreenVersion                (void)                                                        TWOWORDINLINE(0x7014, 0xAB1D);
  216.  
  217. EXTERN_API( QDErr )
  218. NewTempScreenBuffer                (const Rect *            globalRect,
  219.                                  Boolean                 purgeable,
  220.                                  GDHandle *                gdh,
  221.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0015, 0xAB1D);
  222.  
  223. EXTERN_API( Boolean )
  224. PixMap32Bit                        (PixMapHandle             pmHandle)                            FOURWORDINLINE(0x203C, 0x0004, 0x0016, 0xAB1D);
  225.  
  226. EXTERN_API( PixMapHandle )
  227. GetGWorldPixMap                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0017, 0xAB1D);
  228.  
  229.  
  230.  
  231. #if PRAGMA_STRUCT_ALIGN
  232.     #pragma options align=reset
  233. #elif PRAGMA_STRUCT_PACKPUSH
  234.     #pragma pack(pop)
  235. #elif PRAGMA_STRUCT_PACK
  236.     #pragma pack()
  237. #endif
  238.  
  239. #ifdef PRAGMA_IMPORT_OFF
  240. #pragma import off
  241. #elif PRAGMA_IMPORT
  242. #pragma import reset
  243. #endif
  244.  
  245. #ifdef __cplusplus
  246. }
  247. #endif
  248.  
  249. #endif /* __QDOFFSCREEN__ */
  250.  
  251.